def test():
    str1 = input('请输入测试语句：')
    print(str1)
    list1 = str1.split(' ')
    list2 = []
    str2 = " "
    for i in list1:
        if len(i) >= 5:
            i = i[::-1]
        list2.append(i)
    list2 = str2.join(list2)
    return print(list2)

t1 = test()


def times():
    num1 = input('请输入一个整数：')
    num1 = int(num1)
    timess = 0
    for i in range(1,num1+1):
        str1 = str(i)
        timess += str1.count("1")



    return print(timess)

t2 = times()
